const mongoose = require('mongoose');
const goodsModel = require('./goodsModel')
const servicesModel = require('./servicesModel')
const adminModle = require('./adminModle')
const shopsSchema = new mongoose.Schema({
    name: String,
    address: String,
    telephone: String,
    desc: String,
    adminId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: adminModle
    }, // 门店所属管理员id
    goodsId: [
        {
            type: mongoose.Schema.Types.ObjectId,
            ref: goodsModel
        }
    ],
    servicesId: [
        {
            type: mongoose.Schema.Types.ObjectId,
            ref: servicesModel
        }
    ],
    isAvail: Number, // 商品上架前是否通过审核（0：未通过；1：申请中；2：已通过）
    applytype:Number,

})
module.exports = mongoose.model('shopsModel', shopsSchema, 'shops');